/**
 * 节流
 * @param {*} func 
 * @param {*} wait 
 * @returns 
 */
export function throttle(func, wait = 150) {
  let flag = true;
  return function () {
    let that = this;
    let args = arguments;
    if (!flag) {
      return;
    }
    flag = false;
    setTimeout(() => {
      func.apply(that, args);
      flag = true;
    }, wait);
  };
}
